﻿using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using System;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LearningWorkbench
{
    public partial class FormControlPanel : Form
    {
        CollectionPicker cp;
        ClusteringForm cf;
        NeuralNetworkManager nnm;
        TestController tc;

        public FormControlPanel()
        {
            InitializeComponent();
        }

        private void FormControlPanel_Load(object sender, EventArgs e)
        {
            cp = new CollectionPicker();
            cf = new ClusteringForm();
            nnm = new NeuralNetworkManager();
            tc = new TestController();
        }

        private void buttonDataSource_Click(object sender, EventArgs e)
        {
            if (cp.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            buttonDataSource.Enabled = false;
            buttonClassification.Enabled = true;
        }

        private void buttonClassification_Click(object sender, EventArgs e)
        {
            if (cf.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            buttonClassification.Enabled = false;
            buttonTraining.Enabled = true;
        }

        private void buttonTraining_Click(object sender, EventArgs e)
        {
            if (nnm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            buttonTraining.Enabled = false;
            buttonTest.Enabled = true;
        }

        private void buttonTest_Click(object sender, EventArgs e)
        {
            if (tc.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            
            buttonClassification.Enabled = true;
            buttonTest.Enabled = false;
        }
    }
}
